jQuery.fn.pagination=function(maxentries, opts){
opts=jQuery.extend({
items_per_page: 10,
num_display_entries: 10,
current_page: 0,
num_edge_entries: 0,
link_to: "#",
prev_text: "Prev",
next_text: "Next",
ellipse_text: "...",
prev_show_always: true,
next_show_always: true,
data_source: '',
listing_container: '',
callback: function(){
return false;
}}, opts||{});
return this.each(function(){
function numPages(){
return Math.ceil(maxentries / opts.items_per_page);
}
function getInterval(){
var ne_half=Math.ceil(opts.num_display_entries / 2);
var np=numPages();
var upper_limit=np - opts.num_display_entries;
var start=current_page > ne_half ? Math.max(Math.min(current_page - ne_half, upper_limit), 0):0;
var end=current_page > ne_half ? Math.min(current_page + ne_half, np):Math.min(opts.num_display_entries, np);
return [start, end];
}
function pageSelected(page_id, evt){
current_page=page_id;
drawLinks();
var continuePropagation=opts.callback(page_id, panel);
if(!continuePropagation){
if(evt.stopPropagation){
evt.stopPropagation();
}else{
evt.cancelBubble=true;
}}
return continuePropagation;
}
function drawLinks(){
panel.empty();
var interval=getInterval();
var np=numPages();
var getClickHandler=function(page_id){
return function(evt){
return pageSelected(page_id, evt);
}}
var appendItem=function(page_id, appendopts){
page_id=page_id < 0 ? 0:(page_id < np ? page_id:np - 1);
appendopts=jQuery.extend({
text: page_id + 1,
classes: ""
}, appendopts||{});
if(page_id==current_page){
var lnk=jQuery("" + (appendopts.text) + "");
}else{
var lnk=jQuery("" + (appendopts.text) + "")
.bind("click", getClickHandler(page_id))
.attr('href', opts.link_to.replace(/__id__/, page_id));
}
if(appendopts.classes){
lnk.addClass(appendopts.classes);
}
panel.append(lnk);
}
if(opts.prev_text&&(current_page > 0||opts.prev_show_always)){
appendItem(current_page - 1, {
text: opts.prev_text,
classes: "prev"
});
}
if(interval[0] > 0&&opts.num_edge_entries > 0){
var end=Math.min(opts.num_edge_entries, interval[0]);
for (var i=0; i < end; i++){
appendItem(i);
}
if(opts.num_edge_entries < interval[0]&&opts.ellipse_text){
jQuery("" + opts.ellipse_text + "").appendTo(panel);
}}
for (var i=interval[0]; i < interval[1]; i++){
appendItem(i);
}
if(interval[1] < np&&opts.num_edge_entries > 0){
if(np - opts.num_edge_entries > interval[1]&&opts.ellipse_text){
jQuery("" + opts.ellipse_text + "").appendTo(panel);
}
var begin=Math.max(np - opts.num_edge_entries, interval[1]);
for (var i=begin; i < np; i++){
appendItem(i);
}}
if(opts.next_text&&(current_page < np - 1||opts.next_show_always)){
appendItem(current_page + 1, {
text: opts.next_text,
classes: "next"
});
}}
var current_page=opts.current_page;
maxentries=(!maxentries||maxentries < 0) ? 1:maxentries;
opts.items_per_page=(!opts.items_per_page||opts.items_per_page < 0) ? 1:opts.items_per_page;
var panel=jQuery(this);
this.selectPage=function(page_id){
pageSelected(page_id);
}
this.prevPage=function(){
if(current_page > 0){
pageSelected(current_page - 1);
return true;
}else{
return false;
}}
this.nextPage=function(){
if(current_page < numPages() - 1){
pageSelected(current_page + 1);
return true;
}else{
return false;
}}
drawLinks();
opts.callback(current_page, this);
});
}
function ClusterIcon(cluster, styles){
cluster.getMarkerClusterer().extend(ClusterIcon, google.maps.OverlayView);
this.cluster_=cluster;
this.className_=cluster.getMarkerClusterer().getClusterClass();
this.styles_=styles;
this.center_=null;
this.div_=null;
this.sums_=null;
this.visible_=false;
this.setMap(cluster.getMap());
}
ClusterIcon.prototype.onAdd=function(){
var cClusterIcon=this;
var cMouseDownInCluster;
var cDraggingMapByCluster;
this.div_=document.createElement("div");
this.div_.className=this.className_;
if(this.visible_){
this.show();
}
this.getPanes().overlayMouseTarget.appendChild(this.div_);
this.boundsChangedListener_=google.maps.event.addListener(this.getMap(), "bounds_changed", function(){
cDraggingMapByCluster=cMouseDownInCluster;
});
google.maps.event.addDomListener(this.div_, "mousedown", function(){
cMouseDownInCluster=true;
cDraggingMapByCluster=false;
});
google.maps.event.addDomListener(this.div_, "click", function(e){
cMouseDownInCluster=false;
if(!cDraggingMapByCluster){
var theBounds;
var mz;
var mc=cClusterIcon.cluster_.getMarkerClusterer();
google.maps.event.trigger(mc, "click", cClusterIcon.cluster_);
google.maps.event.trigger(mc, "clusterclick", cClusterIcon.cluster_);
if(mc.getZoomOnClick()){
mz=mc.getMaxZoom();
theBounds=cClusterIcon.cluster_.getBounds();
mc.getMap().fitBounds(theBounds);
setTimeout(function(){
mc.getMap().fitBounds(theBounds);
if(mz!==null&&(mc.getMap().getZoom() > mz)){
mc.getMap().setZoom(mz + 1);
}}, 100);
}
e.cancelBubble=true;
if(e.stopPropagation){
e.stopPropagation();
}}
});
google.maps.event.addDomListener(this.div_, "mouseover", function(){
var mc=cClusterIcon.cluster_.getMarkerClusterer();
google.maps.event.trigger(mc, "mouseover", cClusterIcon.cluster_);
});
google.maps.event.addDomListener(this.div_, "mouseout", function(){
var mc=cClusterIcon.cluster_.getMarkerClusterer();
google.maps.event.trigger(mc, "mouseout", cClusterIcon.cluster_);
});
};
ClusterIcon.prototype.onRemove=function(){
if(this.div_&&this.div_.parentNode){
this.hide();
google.maps.event.removeListener(this.boundsChangedListener_);
google.maps.event.clearInstanceListeners(this.div_);
this.div_.parentNode.removeChild(this.div_);
this.div_=null;
}};
ClusterIcon.prototype.draw=function(){
if(this.visible_){
var pos=this.getPosFromLatLng_(this.center_);
this.div_.style.top=pos.y + "px";
this.div_.style.left=pos.x + "px";
}};
ClusterIcon.prototype.hide=function(){
if(this.div_){
this.div_.style.display="none";
}
this.visible_=false;
};
ClusterIcon.prototype.show=function(){
if(this.div_){
var img="";
var bp=this.backgroundPosition_.split(" ");
var spriteH=parseInt(bp[0].replace(/^\s+|\s+$/g, ""), 10);
var spriteV=parseInt(bp[1].replace(/^\s+|\s+$/g, ""), 10);
var pos=this.getPosFromLatLng_(this.center_);
this.div_.style.cssText=this.createCss(pos);
img="";
this.div_.innerHTML=img + "
" + this.sums_.text + "
";
if(typeof this.sums_.title==="undefined"||this.sums_.title===""){
this.div_.title=this.cluster_.getMarkerClusterer().getTitle();
}else{
this.div_.title=this.sums_.title;
}
this.div_.style.display="";
}
this.visible_=true;
};
ClusterIcon.prototype.useStyle=function(sums){
this.sums_=sums;
var index=Math.max(0, sums.index - 1);
index=Math.min(this.styles_.length - 1, index);
var style=this.styles_[index];
this.url_=style.url;
this.height_=style.height;
this.width_=style.width;
this.anchorText_=style.anchorText||[0, 0];
this.anchorIcon_=style.anchorIcon||[parseInt(this.height_ / 2, 10), parseInt(this.width_ / 2, 10)];
this.textColor_=style.textColor||"black";
this.textSize_=style.textSize||11;
this.textDecoration_=style.textDecoration||"none";
this.fontWeight_=style.fontWeight||"bold";
this.fontStyle_=style.fontStyle||"normal";
this.fontFamily_=style.fontFamily||"Arial,sans-serif";
this.backgroundPosition_=style.backgroundPosition||"0 0";
};
ClusterIcon.prototype.setCenter=function(center){
this.center_=center;
};
ClusterIcon.prototype.createCss=function(pos){
var style=[];
style.push("cursor: pointer;");
style.push("position: absolute; top: " + pos.y + "px; left: " + pos.x + "px;");
style.push("width: " + this.width_ + "px; height: " + this.height_ + "px;");
return style.join("");
};
ClusterIcon.prototype.getPosFromLatLng_=function(latlng){
var pos=this.getProjection().fromLatLngToDivPixel(latlng);
pos.x -=this.anchorIcon_[1];
pos.y -=this.anchorIcon_[0];
pos.x=parseInt(pos.x, 10);
pos.y=parseInt(pos.y, 10);
return pos;
};
function Cluster(mc){
this.markerClusterer_=mc;
this.map_=mc.getMap();
this.gridSize_=mc.getGridSize();
this.minClusterSize_=mc.getMinimumClusterSize();
this.averageCenter_=mc.getAverageCenter();
this.markers_=[];
this.center_=null;
this.bounds_=null;
this.clusterIcon_=new ClusterIcon(this, mc.getStyles());
}
Cluster.prototype.getSize=function(){
return this.markers_.length;
};
Cluster.prototype.getMarkers=function(){
return this.markers_;
};
Cluster.prototype.getCenter=function(){
return this.center_;
};
Cluster.prototype.getMap=function(){
return this.map_;
};
Cluster.prototype.getMarkerClusterer=function(){
return this.markerClusterer_;
};
Cluster.prototype.getBounds=function(){
var i;
var bounds=new google.maps.LatLngBounds(this.center_, this.center_);
var markers=this.getMarkers();
for (i=0; i < markers.length; i++){
bounds.extend(markers[i].getPosition());
}
return bounds;
};
Cluster.prototype.remove=function(){
this.clusterIcon_.setMap(null);
this.markers_=[];
delete this.markers_;
};
Cluster.prototype.addMarker=function(marker){
var i;
var mCount;
var mz;
if(this.isMarkerAlreadyAdded_(marker)){
return false;
}
if(!this.center_){
this.center_=marker.getPosition();
this.calculateBounds_();
}else{
if(this.averageCenter_){
var l=this.markers_.length + 1;
var lat=(this.center_.lat() * (l - 1) + marker.getPosition().lat()) / l;
var lng=(this.center_.lng() * (l - 1) + marker.getPosition().lng()) / l;
this.center_=new google.maps.LatLng(lat, lng);
this.calculateBounds_();
}}
marker.isAdded=true;
this.markers_.push(marker);
mCount=this.markers_.length;
mz=this.markerClusterer_.getMaxZoom();
if(mz!==null&&this.map_.getZoom() > mz){
if(marker.getMap()!==this.map_){
marker.setMap(this.map_);
}}else if(mCount < this.minClusterSize_){
if(marker.getMap()!==this.map_){
marker.setMap(this.map_);
}}else if(mCount===this.minClusterSize_){
for (i=0; i < mCount; i++){
this.markers_[i].setMap(null);
}}else{
marker.setMap(null);
}
this.updateIcon_();
return true;
};
Cluster.prototype.isMarkerInClusterBounds=function(marker){
return this.bounds_.contains(marker.getPosition());
};
Cluster.prototype.calculateBounds_=function(){
var bounds=new google.maps.LatLngBounds(this.center_, this.center_);
this.bounds_=this.markerClusterer_.getExtendedBounds(bounds);
};
Cluster.prototype.updateIcon_=function(){
var mCount=this.markers_.length;
var mz=this.markerClusterer_.getMaxZoom();
if(mz!==null&&this.map_.getZoom() > mz){
this.clusterIcon_.hide();
return;
}
if(mCount < this.minClusterSize_){
this.clusterIcon_.hide();
return;
}
var numStyles=this.markerClusterer_.getStyles().length;
var sums=this.markerClusterer_.getCalculator()(this.markers_, numStyles);
this.clusterIcon_.setCenter(this.center_);
this.clusterIcon_.useStyle(sums);
this.clusterIcon_.show();
};
Cluster.prototype.isMarkerAlreadyAdded_=function(marker){
var i;
if(this.markers_.indexOf){
return this.markers_.indexOf(marker)!==-1;
}else{
for (i=0; i < this.markers_.length; i++){
if(marker===this.markers_[i]){
return true;
}}
}
return false;
};
function MarkerClusterer(map, opt_markers, opt_options){
this.extend(MarkerClusterer, google.maps.OverlayView);
opt_markers=opt_markers||[];
opt_options=opt_options||{};
this.markers_=[];
this.clusters_=[];
this.listeners_=[];
this.activeMap_=null;
this.ready_=false;
this.gridSize_=opt_options.gridSize||60;
this.minClusterSize_=opt_options.minimumClusterSize||2;
this.maxZoom_=opt_options.maxZoom||null;
this.styles_=opt_options.styles||[];
this.title_=opt_options.title||"";
this.zoomOnClick_=true;
if(opt_options.zoomOnClick!==undefined){
this.zoomOnClick_=opt_options.zoomOnClick;
}
this.averageCenter_=false;
if(opt_options.averageCenter!==undefined){
this.averageCenter_=opt_options.averageCenter;
}
this.ignoreHidden_=false;
if(opt_options.ignoreHidden!==undefined){
this.ignoreHidden_=opt_options.ignoreHidden;
}
this.enableRetinaIcons_=false;
if(opt_options.enableRetinaIcons!==undefined){
this.enableRetinaIcons_=opt_options.enableRetinaIcons;
}
this.imagePath_=opt_options.imagePath||MarkerClusterer.IMAGE_PATH;
this.imageExtension_=opt_options.imageExtension||MarkerClusterer.IMAGE_EXTENSION;
this.imageSizes_=opt_options.imageSizes||MarkerClusterer.IMAGE_SIZES;
this.calculator_=opt_options.calculator||MarkerClusterer.CALCULATOR;
this.batchSize_=opt_options.batchSize||MarkerClusterer.BATCH_SIZE;
this.batchSizeIE_=opt_options.batchSizeIE||MarkerClusterer.BATCH_SIZE_IE;
this.clusterClass_=opt_options.clusterClass||"cluster";
if(navigator.userAgent.toLowerCase().indexOf("msie")!==-1){
this.batchSize_=this.batchSizeIE_;
}
this.setupStyles_();
this.addMarkers(opt_markers, true);
this.setMap(map);
}
MarkerClusterer.prototype.onAdd=function(){
var cMarkerClusterer=this;
this.activeMap_=this.getMap();
this.ready_=true;
this.repaint();
this.listeners_=[
google.maps.event.addListener(this.getMap(), "zoom_changed", function(){
cMarkerClusterer.resetViewport_(false);
if(this.getZoom()===(this.get("minZoom")||0)||this.getZoom()===this.get("maxZoom")){
google.maps.event.trigger(this, "idle");
}}),
google.maps.event.addListener(this.getMap(), "idle", function(){
cMarkerClusterer.redraw_();
})
];
};
MarkerClusterer.prototype.onRemove=function(){
var i;
for (i=0; i < this.markers_.length; i++){
if(this.markers_[i].getMap()!==this.activeMap_){
this.markers_[i].setMap(this.activeMap_);
}}
for (i=0; i < this.clusters_.length; i++){
this.clusters_[i].remove();
}
this.clusters_=[];
for (i=0; i < this.listeners_.length; i++){
google.maps.event.removeListener(this.listeners_[i]);
}
this.listeners_=[];
this.activeMap_=null;
this.ready_=false;
};
MarkerClusterer.prototype.draw=function(){};
MarkerClusterer.prototype.setupStyles_=function(){
var i, size;
if(this.styles_.length > 0){
return;
}
for (i=0; i < this.imageSizes_.length; i++){
size=this.imageSizes_[i];
this.styles_.push({
url: this.imagePath_ + (i + 1) + "." + this.imageExtension_,
height: size,
width: size
});
}};
MarkerClusterer.prototype.fitMapToMarkers=function(){
var i;
var markers=this.getMarkers();
var bounds=new google.maps.LatLngBounds();
for (i=0; i < markers.length; i++){
bounds.extend(markers[i].getPosition());
}
this.getMap().fitBounds(bounds);
};
MarkerClusterer.prototype.getGridSize=function(){
return this.gridSize_;
};
MarkerClusterer.prototype.setGridSize=function(gridSize){
this.gridSize_=gridSize;
};
MarkerClusterer.prototype.getMinimumClusterSize=function(){
return this.minClusterSize_;
};
MarkerClusterer.prototype.setMinimumClusterSize=function(minimumClusterSize){
this.minClusterSize_=minimumClusterSize;
};
MarkerClusterer.prototype.getMaxZoom=function(){
return this.maxZoom_;
};
MarkerClusterer.prototype.setMaxZoom=function(maxZoom){
this.maxZoom_=maxZoom;
};
MarkerClusterer.prototype.getStyles=function(){
return this.styles_;
};
MarkerClusterer.prototype.setStyles=function(styles){
this.styles_=styles;
};
MarkerClusterer.prototype.getTitle=function(){
return this.title_;
};
MarkerClusterer.prototype.setTitle=function(title){
this.title_=title;
};
MarkerClusterer.prototype.getZoomOnClick=function(){
return this.zoomOnClick_;
};
MarkerClusterer.prototype.setZoomOnClick=function(zoomOnClick){
this.zoomOnClick_=zoomOnClick;
};
MarkerClusterer.prototype.getAverageCenter=function(){
return this.averageCenter_;
};
MarkerClusterer.prototype.setAverageCenter=function(averageCenter){
this.averageCenter_=averageCenter;
};
MarkerClusterer.prototype.getIgnoreHidden=function(){
return this.ignoreHidden_;
};
MarkerClusterer.prototype.setIgnoreHidden=function(ignoreHidden){
this.ignoreHidden_=ignoreHidden;
};
MarkerClusterer.prototype.getEnableRetinaIcons=function(){
return this.enableRetinaIcons_;
};
MarkerClusterer.prototype.setEnableRetinaIcons=function(enableRetinaIcons){
this.enableRetinaIcons_=enableRetinaIcons;
};
MarkerClusterer.prototype.getImageExtension=function(){
return this.imageExtension_;
};
MarkerClusterer.prototype.setImageExtension=function(imageExtension){
this.imageExtension_=imageExtension;
};
MarkerClusterer.prototype.getImagePath=function(){
return this.imagePath_;
};
MarkerClusterer.prototype.setImagePath=function(imagePath){
this.imagePath_=imagePath;
};
MarkerClusterer.prototype.getImageSizes=function(){
return this.imageSizes_;
};
MarkerClusterer.prototype.setImageSizes=function(imageSizes){
this.imageSizes_=imageSizes;
};
MarkerClusterer.prototype.getCalculator=function(){
return this.calculator_;
};
/**
* Sets the value of the calculator
property.
*
* @param {function(Array., number)} calculator The value
* of the calculator property.
*/
MarkerClusterer.prototype.setCalculator=function(calculator){
this.calculator_=calculator;
};
MarkerClusterer.prototype.getBatchSizeIE=function(){
return this.batchSizeIE_;
};
MarkerClusterer.prototype.setBatchSizeIE=function(batchSizeIE){
this.batchSizeIE_=batchSizeIE;
};
MarkerClusterer.prototype.getClusterClass=function(){
return this.clusterClass_;
};
MarkerClusterer.prototype.setClusterClass=function(clusterClass){
this.clusterClass_=clusterClass;
};
MarkerClusterer.prototype.getMarkers=function(){
return this.markers_;
};
MarkerClusterer.prototype.getTotalMarkers=function(){
return this.markers_.length;
};
MarkerClusterer.prototype.getClusters=function(){
return this.clusters_;
};
MarkerClusterer.prototype.getTotalClusters=function(){
return this.clusters_.length;
};
MarkerClusterer.prototype.addMarker=function(marker, opt_nodraw){
this.pushMarkerTo_(marker);
if(!opt_nodraw){
this.redraw_();
}};
MarkerClusterer.prototype.addMarkers=function(markers, opt_nodraw){
var key;
for (key in markers){
if(markers.hasOwnProperty(key)){
this.pushMarkerTo_(markers[key]);
}}
if(!opt_nodraw){
this.redraw_();
}};
MarkerClusterer.prototype.pushMarkerTo_=function(marker){
if(marker.getDraggable()){
var cMarkerClusterer=this;
google.maps.event.addListener(marker, "dragend", function(){
if(cMarkerClusterer.ready_){
this.isAdded=false;
cMarkerClusterer.repaint();
}});
}
marker.isAdded=false;
this.markers_.push(marker);
};
MarkerClusterer.prototype.removeMarker=function(marker, opt_nodraw){
var removed=this.removeMarker_(marker);
if(!opt_nodraw&&removed){
this.repaint();
}
return removed;
};
MarkerClusterer.prototype.removeMarkers=function(markers, opt_nodraw){
var i, r;
var removed=false;
for (i=0; i < markers.length; i++){
r=this.removeMarker_(markers[i]);
removed=removed||r;
}
if(!opt_nodraw&&removed){
this.repaint();
}
return removed;
};
MarkerClusterer.prototype.removeMarker_=function(marker){
var i;
var index=-1;
if(this.markers_.indexOf){
index=this.markers_.indexOf(marker);
}else{
for (i=0; i < this.markers_.length; i++){
if(marker===this.markers_[i]){
index=i;
break;
}}
}
if(index===-1){
return false;
}
marker.setMap(null);
this.markers_.splice(index, 1);
return true;
};
MarkerClusterer.prototype.clearMarkers=function(){
this.resetViewport_(true);
this.markers_=[];
};
MarkerClusterer.prototype.repaint=function(){
var oldClusters=this.clusters_.slice();
this.clusters_=[];
this.resetViewport_(false);
this.redraw_();
setTimeout(function(){
var i;
for (i=0; i < oldClusters.length; i++){
oldClusters[i].remove();
}}, 0);
};
MarkerClusterer.prototype.getExtendedBounds=function(bounds){
var projection=this.getProjection();
var tr=new google.maps.LatLng(bounds.getNorthEast().lat(),
bounds.getNorthEast().lng());
var bl=new google.maps.LatLng(bounds.getSouthWest().lat(),
bounds.getSouthWest().lng());
var trPix=projection.fromLatLngToDivPixel(tr);
trPix.x +=this.gridSize_;
trPix.y -=this.gridSize_;
var blPix=projection.fromLatLngToDivPixel(bl);
blPix.x -=this.gridSize_;
blPix.y +=this.gridSize_;
var ne=projection.fromDivPixelToLatLng(trPix);
var sw=projection.fromDivPixelToLatLng(blPix);
bounds.extend(ne);
bounds.extend(sw);
return bounds;
};
MarkerClusterer.prototype.redraw_=function(){
this.createClusters_(0);
};
MarkerClusterer.prototype.resetViewport_=function(opt_hide){
var i, marker;
for (i=0; i < this.clusters_.length; i++){
this.clusters_[i].remove();
}
this.clusters_=[];
for (i=0; i < this.markers_.length; i++){
marker=this.markers_[i];
marker.isAdded=false;
if(opt_hide){
marker.setMap(null);
}}
};
MarkerClusterer.prototype.distanceBetweenPoints_=function(p1, p2){
var R=6371;
var dLat=(p2.lat() - p1.lat()) * Math.PI / 180;
var dLon=(p2.lng() - p1.lng()) * Math.PI / 180;
var a=Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(p1.lat() * Math.PI / 180) * Math.cos(p2.lat() * Math.PI / 180) *
Math.sin(dLon / 2) * Math.sin(dLon / 2);
var c=2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
var d=R * c;
return d;
};
MarkerClusterer.prototype.isMarkerInBounds_=function(marker, bounds){
return bounds.contains(marker.getPosition());
};
MarkerClusterer.prototype.addToClosestCluster_=function(marker){
var i, d, cluster, center;
var distance=40000;
var clusterToAddTo=null;
for (i=0; i < this.clusters_.length; i++){
cluster=this.clusters_[i];
center=cluster.getCenter();
if(center){
d=this.distanceBetweenPoints_(center, marker.getPosition());
if(d < distance){
distance=d;
clusterToAddTo=cluster;
}}
}
if(clusterToAddTo&&clusterToAddTo.isMarkerInClusterBounds(marker)){
clusterToAddTo.addMarker(marker);
}else{
cluster=new Cluster(this);
cluster.addMarker(marker);
this.clusters_.push(cluster);
}};
MarkerClusterer.prototype.createClusters_=function(iFirst){
var i, marker;
var mapBounds;
var cMarkerClusterer=this;
if(!this.ready_){
return;
}
if(iFirst===0){
google.maps.event.trigger(this, "clusteringbegin", this);
if(typeof this.timerRefStatic!=="undefined"){
clearTimeout(this.timerRefStatic);
delete this.timerRefStatic;
}}
if(this.getMap().getZoom() > 3){
mapBounds=new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),
this.getMap().getBounds().getNorthEast());
}else{
mapBounds=new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));
}
var bounds=this.getExtendedBounds(mapBounds);
var iLast=Math.min(iFirst + this.batchSize_, this.markers_.length);
for (i=iFirst; i < iLast; i++){
marker=this.markers_[i];
if(!marker.isAdded&&this.isMarkerInBounds_(marker, bounds)){
if(!this.ignoreHidden_||(this.ignoreHidden_&&marker.getVisible())){
this.addToClosestCluster_(marker);
}}
}
if(iLast < this.markers_.length){
this.timerRefStatic=setTimeout(function(){
cMarkerClusterer.createClusters_(iLast);
}, 0);
}else{
delete this.timerRefStatic;
google.maps.event.trigger(this, "clusteringend", this);
}};
MarkerClusterer.prototype.extend=function(obj1, obj2){
return (function(object){
var property;
for (property in object.prototype){
this.prototype[property]=object.prototype[property];
}
return this;
}).apply(obj1, [obj2]);
};
MarkerClusterer.CALCULATOR=function(markers, numStyles){
var index=0;
var title="";
var count=markers.length.toString();
var dv=count;
while (dv!==0){
dv=parseInt(dv / 10, 10);
index++;
}
index=Math.min(index, numStyles);
return {
text: count,
index: index,
title: title
};};
MarkerClusterer.BATCH_SIZE=2000;
MarkerClusterer.BATCH_SIZE_IE=500;
MarkerClusterer.IMAGE_PATH="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/images/m";
MarkerClusterer.IMAGE_EXTENSION="png";
MarkerClusterer.IMAGE_SIZES=[53, 56, 66, 78, 90];
(function($){
$.fn.accordion=function(options){
if(!this||this.length < 1){
return this;
}
initialize(this, options);
};
function initialize(obj, options){
var opts=$.extend({}, $.fn.accordion.defaults, options);
var opened='';
obj.each(function(){
var $this=$(this);
saveOpts($this, opts);
if(opts.bind=='mouseenter'){
$this.bind('mouseenter', function(e){
e.preventDefault();
toggle($this, opts);
});
}
if(opts.bind=='mouseover'){
$this.bind('mouseover', function(e){
e.preventDefault();
toggle($this, opts);
});
}
if(opts.bind=='click'){
$this.bind('click', function(e){
e.preventDefault();
toggle($this, opts);
});
}
if(opts.bind=='dblclick'){
$this.bind('dblclick', function(e){
e.preventDefault();
toggle($this, opts);
});
}
id=$this.attr('id');
if(!useCookies(opts)){
if(id!=opts.defaultOpen){
$this.addClass(opts.cssClose);
opts.loadClose($this, opts);
}else{
$this.addClass(opts.cssOpen);
opts.loadOpen($this, opts);
opened=id;
}}else{
if(issetCookie(opts)){
if(inCookie(id, opts)===false){
$this.addClass(opts.cssClose);
opts.loadClose($this, opts);
}else{
$this.addClass(opts.cssOpen);
opts.loadOpen($this, opts);
opened=id;
}}else{
if(id!=opts.defaultOpen){
$this.addClass(opts.cssClose);
opts.loadClose($this, opts);
}else{
$this.addClass(opts.cssOpen);
opts.loadOpen($this, opts);
opened=id;
}}
}});
if(opened.length > 0&&useCookies(opts)){
setCookie(opened, opts);
}else{
setCookie('', opts);
}
return obj;
};
function loadOpts($this){
return $this.data('accordion-opts');
}
function saveOpts($this, opts){
return $this.data('accordion-opts', opts);
}
function close(opts){
opened=$(document).find('.' + opts.cssOpen);
$.each(opened, function(){
$(this).addClass(opts.cssClose).removeClass(opts.cssOpen);
opts.animateClose($(this), opts);
});
}
function open($this, opts){
close(opts);
$this.removeClass(opts.cssClose).addClass(opts.cssOpen);
opts.animateOpen($this, opts);
if(useCookies(opts)){
id=$this.attr('id');
setCookie(id, opts);
}}
function toggle($this, opts){
if($this.hasClass(opts.cssOpen)){
close(opts);
if(useCookies(opts)){
setCookie('', opts);
}
return false;
}
close(opts);
open($this, opts);
return false;
}
function useCookies(opts){
if(!$.cookie||opts.cookieName==''){
return false;
}
return true;
}
function setCookie(value, opts){
if(!useCookies(opts)){
return false;
}
$.cookie(opts.cookieName, value, opts.cookieOptions);
}
function inCookie(value, opts){
if(!useCookies(opts)){
return false;
}
if(!issetCookie(opts)){
return false;
}
cookie=unescape($.cookie(opts.cookieName));
if(cookie!=value){
return false;
}
return true;
}
function issetCookie(opts){
if(!useCookies(opts)){
return false;
}
if($.cookie(opts.cookieName)==null){
return false;
}
return true;
}
$.fn.accordion.defaults={
cssClose: 'accordion-close',
cssOpen: 'accordion-open',
cookieName: 'accordion',
cookieOptions: {
path: '/',
expires: 7,
domain: '',
secure: ''
},
defaultOpen: '',
speed: 'slow',
bind: 'click',
animateOpen: function(elem, opts){
elem.next().stop(true, true).slideDown(opts.speed);
},
animateClose: function(elem, opts){
elem.next().stop(true, true).slideUp(opts.speed);
},
loadOpen: function(elem, opts){
elem.next().show();
},
loadClose: function(elem, opts){
elem.next().hide();
}};})(jQuery);
(function(factory){
if(typeof define==='function'&&define.amd){
define(['jquery'], factory);
}else if(typeof exports==='object'){
module.exports=factory;
}else{
factory(jQuery);
}}(function($){
var toFix=['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
toBind=('onwheel' in document||document.documentMode >=9) ? ['wheel']:['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
slice=Array.prototype.slice,
nullLowestDeltaTimeout, lowestDelta;
if($.event.fixHooks){
for (var i=toFix.length; i;){
$.event.fixHooks[toFix[--i]]=$.event.mouseHooks;
}}
var special=$.event.special.mousewheel={
version: '3.1.9',
setup: function(){
if(this.addEventListener){
for (var i=toBind.length; i;){
this.addEventListener(toBind[--i], handler, false);
}}else{
this.onmousewheel=handler;
}
$.data(this, 'mousewheel-line-height', special.getLineHeight(this));
$.data(this, 'mousewheel-page-height', special.getPageHeight(this));
},
teardown: function(){
if(this.removeEventListener){
for (var i=toBind.length; i;){
this.removeEventListener(toBind[--i], handler, false);
}}else{
this.onmousewheel=null;
}},
getLineHeight: function(elem){
return parseInt($(elem)['offsetParent' in $.fn ? 'offsetParent':'parent']().css('fontSize'), 10);
},
getPageHeight: function(elem){
return $(elem).height();
},
settings: {
adjustOldDeltas: true
}};
$.fn.extend({
mousewheel: function(fn){
return fn ? this.bind('mousewheel', fn):this.trigger('mousewheel');
},
unmousewheel: function(fn){
return this.unbind('mousewheel', fn);
}});
function handler(event){
var orgEvent=event||window.event,
args=slice.call(arguments, 1),
delta=0,
deltaX=0,
deltaY=0,
absDelta=0;
event=$.event.fix(orgEvent);
event.type='mousewheel';
if('detail' in orgEvent){
deltaY=orgEvent.detail * -1;
}
if('wheelDelta' in orgEvent){
deltaY=orgEvent.wheelDelta;
}
if('wheelDeltaY' in orgEvent){
deltaY=orgEvent.wheelDeltaY;
}
if('wheelDeltaX' in orgEvent){
deltaX=orgEvent.wheelDeltaX * -1;
}
if('axis' in orgEvent&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS){
deltaX=deltaY * -1;
deltaY=0;
}
delta=deltaY===0 ? deltaX:deltaY;
if('deltaY' in orgEvent){
deltaY=orgEvent.deltaY * -1;
delta=deltaY;
}
if('deltaX' in orgEvent){
deltaX=orgEvent.deltaX;
if(deltaY===0){
delta=deltaX * -1;
}}
if(deltaY===0&&deltaX===0){
return;
}
if(orgEvent.deltaMode===1){
var lineHeight=$.data(this, 'mousewheel-line-height');
delta *=lineHeight;
deltaY *=lineHeight;
deltaX *=lineHeight;
}else if(orgEvent.deltaMode===2){
var pageHeight=$.data(this, 'mousewheel-page-height');
delta *=pageHeight;
deltaY *=pageHeight;
deltaX *=pageHeight;
}
absDelta=Math.max(Math.abs(deltaY), Math.abs(deltaX));
if(!lowestDelta||absDelta < lowestDelta){
lowestDelta=absDelta;
if(shouldAdjustOldDeltas(orgEvent, absDelta)){
lowestDelta /=40;
}}
if(shouldAdjustOldDeltas(orgEvent, absDelta)){
delta /=40;
deltaX /=40;
deltaY /=40;
}
delta=Math[delta >=1 ? 'floor':'ceil'](delta / lowestDelta);
deltaX=Math[deltaX >=1 ? 'floor':'ceil'](deltaX / lowestDelta);
deltaY=Math[deltaY >=1 ? 'floor':'ceil'](deltaY / lowestDelta);
event.deltaX=deltaX;
event.deltaY=deltaY;
event.deltaFactor=lowestDelta;
event.deltaMode=0;
args.unshift(event, delta, deltaX, deltaY);
if(nullLowestDeltaTimeout){
clearTimeout(nullLowestDeltaTimeout);
}
nullLowestDeltaTimeout=setTimeout(nullLowestDelta, 200);
return ($.event.dispatch||$.event.handle).apply(this, args);
}
function nullLowestDelta(){
lowestDelta=null;
}
function shouldAdjustOldDeltas(orgEvent, absDelta){
return special.settings.adjustOldDeltas&&orgEvent.type==='mousewheel'&&absDelta % 120===0;
}}));
! function(a, b, c){
a.fn.jScrollPane=function(d){
function e(d, e){
function f(b){
var e, h, j, l, m, n, q = !1,
r = !1;
if(P=b, Q===c) m=d.scrollTop(), n=d.scrollLeft(), d.css({
overflow: "hidden",
padding: 0
}), R=d.innerWidth() + tb, S=d.innerHeight(), d.width(R), Q=a('').css("padding", sb).append(d.children()), T=a('').css({
width: R + "px",
height: S + "px"
}).append(Q).appendTo(d);
else {
if(d.css("width", ""), q=P.stickToBottom&&C(), r=P.stickToRight&&D(), l=d.innerWidth() + tb!=R||d.outerHeight()!=S, l&&(R=d.innerWidth() + tb, S=d.innerHeight(), T.css({
width: R + "px",
height: S + "px"
})), !l&&ub==U&&Q.outerHeight()==V) return d.width(R), void 0;
ub=U, Q.css("width", ""), d.width(R), T.find(">.jspVerticalBar,>.jspHorizontalBar").remove().end()
}
Q.css("overflow", "auto"), U=b.contentWidth ? b.contentWidth:Q[0].scrollWidth, V=Q[0].scrollHeight, Q.css("overflow", ""), W=U / R, X=V / S, Y=X > 1, Z=W > 1, Z||Y ? (d.addClass("jspScrollable"), e=P.maintainPosition&&(ab||db), e&&(h=A(), j=B()), g(), i(), k(), e&&(y(r ? U - R:h, !1), x(q ? V - S:j, !1)), H(), E(), N(), P.enableKeyboardNavigation&&J(), P.clickOnTrack&&o(), L(), P.hijackInternalLinks&&M()):(d.removeClass("jspScrollable"), Q.css({
top: 0,
left: 0,
width: T.width() - tb
}), F(), I(), K(), p()), P.autoReinitialise&&!rb ? rb=setInterval(function(){
f(P)
}, P.autoReinitialiseDelay):!P.autoReinitialise&&rb&&clearInterval(rb), m&&d.scrollTop(0)&&x(m, !1), n&&d.scrollLeft(0)&&y(n, !1), d.trigger("jsp-initialised", [Z||Y])
}
function g(){
Y&&(T.append(a('').append(a(''), a('').append(a('').append(a(''), a(''))), a(''))), eb=T.find(">.jspVerticalBar"), fb=eb.find(">.jspTrack"), $=fb.find(">.jspDrag"), P.showArrows&&(jb=a('').bind("mousedown.jsp", m(0, -1)).bind("click.jsp", G), kb=a('').bind("mousedown.jsp", m(0, 1)).bind("click.jsp", G), P.arrowScrollOnHover&&(jb.bind("mouseover.jsp", m(0, -1, jb)), kb.bind("mouseover.jsp", m(0, 1, kb))), l(fb, P.verticalArrowPositions, jb, kb)), hb=S, T.find(">.jspVerticalBar>.jspCap:visible,>.jspVerticalBar>.jspArrow").each(function(){
hb -=a(this).outerHeight()
}), $.hover(function(){
$.addClass("jspHover")
}, function(){
$.removeClass("jspHover")
}).bind("mousedown.jsp", function(b){
a("html").bind("dragstart.jsp selectstart.jsp", G), $.addClass("jspActive");
var c=b.pageY - $.position().top;
return a("html").bind("mousemove.jsp", function(a){
r(a.pageY - c, !1)
}).bind("mouseup.jsp mouseleave.jsp", q), !1
}), h())
}
function h(){
fb.height(hb + "px"), ab=0, gb=P.verticalGutter + fb.outerWidth(), Q.width(R - gb - tb);
try {
0===eb.position().left&&Q.css("margin-left", gb + "px")
} catch (a){}}
function i(){
Z&&(T.append(a('').append(a(''), a('').append(a('').append(a(''), a(''))), a(''))), lb=T.find(">.jspHorizontalBar"), mb=lb.find(">.jspTrack"), bb=mb.find(">.jspDrag"), P.showArrows&&(pb=a('').bind("mousedown.jsp", m(-1, 0)).bind("click.jsp", G), qb=a('').bind("mousedown.jsp", m(1, 0)).bind("click.jsp", G), P.arrowScrollOnHover&&(pb.bind("mouseover.jsp", m(-1, 0, pb)), qb.bind("mouseover.jsp", m(1, 0, qb))), l(mb, P.horizontalArrowPositions, pb, qb)), bb.hover(function(){
bb.addClass("jspHover")
}, function(){
bb.removeClass("jspHover")
}).bind("mousedown.jsp", function(b){
a("html").bind("dragstart.jsp selectstart.jsp", G), bb.addClass("jspActive");
var c=b.pageX - bb.position().left;
return a("html").bind("mousemove.jsp", function(a){
t(a.pageX - c, !1)
}).bind("mouseup.jsp mouseleave.jsp", q), !1
}), nb=T.innerWidth(), j())
}
function j(){
T.find(">.jspHorizontalBar>.jspCap:visible,>.jspHorizontalBar>.jspArrow").each(function(){
nb -=a(this).outerWidth()
}), mb.width(nb + "px"), db=0
}
function k(){
if(Z&&Y){
var b=mb.outerHeight(),
c=fb.outerWidth();
hb -=b, a(lb).find(">.jspCap:visible,>.jspArrow").each(function(){
nb +=a(this).outerWidth()
}), nb -=c, S -=c, R -=b, mb.parent().append(a('').css("width", b + "px")), h(), j()
}
Z&&Q.width(T.outerWidth() - tb + "px"), V=Q.outerHeight(), X=V / S, Z&&(ob=Math.ceil(1 / W * nb), ob > P.horizontalDragMaxWidth ? ob=P.horizontalDragMaxWidth:ob < P.horizontalDragMinWidth&&(ob=P.horizontalDragMinWidth), bb.width(ob + "px"), cb=nb - ob, u(db)), Y&&(ib=Math.ceil(1 / X * hb), ib > P.verticalDragMaxHeight ? ib=P.verticalDragMaxHeight:ib < P.verticalDragMinHeight&&(ib=P.verticalDragMinHeight), $.height(ib + "px"), _=hb - ib, s(ab))
}
function l(a, b, c, d){
var e, f="before",
g="after";
"os"==b&&(b=/Mac/.test(navigator.platform) ? "after":"split"), b==f ? g=b:b==g&&(f=b, e=c, c=d, d=e), a[f](c)[g](d)
}
function m(a, b, c){
return function(){
return n(a, b, this, c), this.blur(), !1
}}
function n(b, c, d, e){
d=a(d).addClass("jspActive");
var f, g, h = !0,
i=function(){
0!==b&&vb.scrollByX(b * P.arrowButtonSpeed), 0!==c&&vb.scrollByY(c * P.arrowButtonSpeed), g=setTimeout(i, h ? P.initialDelay:P.arrowRepeatFreq), h = !1
};
i(), f=e ? "mouseout.jsp":"mouseup.jsp", e=e||a("html"), e.bind(f, function(){
d.removeClass("jspActive"), g&&clearTimeout(g), g=null, e.unbind(f)
})
}
function o(){
p(), Y&&fb.bind("mousedown.jsp", function(b){
if(b.originalTarget===c||b.originalTarget==b.currentTarget){
var d, e=a(this),
f=e.offset(),
g=b.pageY - f.top - ab,
h = !0,
i=function(){
var a=e.offset(),
c=b.pageY - a.top - ib / 2,
f=S * P.scrollPagePercent,
k=_ * f / (V - S);
if(0 > g) ab - k > c ? vb.scrollByY(-f):r(c);
else {
if(!(g > 0)) return j(), void 0;
c > ab + k ? vb.scrollByY(f):r(c)
}
d=setTimeout(i, h ? P.initialDelay:P.trackClickRepeatFreq), h = !1
},
j=function(){
d&&clearTimeout(d), d=null, a(document).unbind("mouseup.jsp", j)
};
return i(), a(document).bind("mouseup.jsp", j), !1
}}), Z&&mb.bind("mousedown.jsp", function(b){
if(b.originalTarget===c||b.originalTarget==b.currentTarget){
var d, e=a(this),
f=e.offset(),
g=b.pageX - f.left - db,
h = !0,
i=function(){
var a=e.offset(),
c=b.pageX - a.left - ob / 2,
f=R * P.scrollPagePercent,
k=cb * f / (U - R);
if(0 > g) db - k > c ? vb.scrollByX(-f):t(c);
else {
if(!(g > 0)) return j(), void 0;
c > db + k ? vb.scrollByX(f):t(c)
}
d=setTimeout(i, h ? P.initialDelay:P.trackClickRepeatFreq), h = !1
},
j=function(){
d&&clearTimeout(d), d=null, a(document).unbind("mouseup.jsp", j)
};
return i(), a(document).bind("mouseup.jsp", j), !1
}})
}
function p(){
mb&&mb.unbind("mousedown.jsp"), fb&&fb.unbind("mousedown.jsp")
}
function q(){
a("html").unbind("dragstart.jsp selectstart.jsp mousemove.jsp mouseup.jsp mouseleave.jsp"), $&&$.removeClass("jspActive"), bb&&bb.removeClass("jspActive")
}
function r(a, b){
Y&&(0 > a ? a=0:a > _&&(a=_), b===c&&(b=P.animateScroll), b ? vb.animate($, "top", a, s):($.css("top", a), s(a)))
}
function s(a){
a===c&&(a=$.position().top), T.scrollTop(0), ab=a;
var b=0===ab,
e=ab==_,
f=a / _,
g=-f * (V - S);
(wb!=b||yb!=e)&&(wb=b, yb=e, d.trigger("jsp-arrow-change", [wb, yb, xb, zb])), v(b, e), Q.css("top", g), d.trigger("jsp-scroll-y", [-g, b, e]).trigger("scroll")
}
function t(a, b){
Z&&(0 > a ? a=0:a > cb&&(a=cb), b===c&&(b=P.animateScroll), b ? vb.animate(bb, "left", a, u):(bb.css("left", a), u(a)))
}
function u(a){
a===c&&(a=bb.position().left), T.scrollTop(0), db=a;
var b=0===db,
e=db==cb,
f=a / cb,
g=-f * (U - R);
(xb!=b||zb!=e)&&(xb=b, zb=e, d.trigger("jsp-arrow-change", [wb, yb, xb, zb])), w(b, e), Q.css("left", g), d.trigger("jsp-scroll-x", [-g, b, e]).trigger("scroll")
}
function v(a, b){
P.showArrows&&(jb[a ? "addClass":"removeClass"]("jspDisabled"), kb[b ? "addClass":"removeClass"]("jspDisabled"))
}
function w(a, b){
P.showArrows&&(pb[a ? "addClass":"removeClass"]("jspDisabled"), qb[b ? "addClass":"removeClass"]("jspDisabled"))
}
function x(a, b){
var c=a / (V - S);
r(c * _, b)
}
function y(a, b){
var c=a / (U - R);
t(c * cb, b)
}
function z(b, c, d){
var e, f, g, h, i, j, k, l, m, n=0,
o=0;
try {
e=a(b)
} catch (p){
return
}
for (f=e.outerHeight(), g=e.outerWidth(), T.scrollTop(0), T.scrollLeft(0); !e.is(".jspPane");)
if(n +=e.position().top, o +=e.position().left, e=e.offsetParent(), /^body|html$/i.test(e[0].nodeName)) return;
h=B(), j=h + S, h > n||c ? l=n - P.horizontalGutter:n + f > j&&(l=n - S + f + P.horizontalGutter), isNaN(l)||x(l, d), i=A(), k=i + R, i > o||c ? m=o - P.horizontalGutter:o + g > k&&(m=o - R + g + P.horizontalGutter), isNaN(m)||y(m, d)
}
function A(){
return -Q.position().left
}
function B(){
return -Q.position().top
}
function C(){
var a=V - S;
return a > 20&&a - B() < 10
}
function D(){
var a=U - R;
return a > 20&&a - A() < 10
}
function E(){
T.unbind(Bb).bind(Bb, function(a, b, c, d){
var e=db,
f=ab,
g=a.deltaFactor||P.mouseWheelSpeed;
return vb.scrollBy(c * g, -d * g, !1), e==db&&f==ab
})
}
function F(){
T.unbind(Bb)
}
function G(){
return !1
}
function H(){
Q.find(":input,a").unbind("focus.jsp").bind("focus.jsp", function(a){
z(a.target, !1)
})
}
function I(){
Q.find(":input,a").unbind("focus.jsp")
}
function J(){
function b(){
var a=db,
b=ab;
switch (c){
case 40:
vb.scrollByY(P.keyboardSpeed, !1);
break;
case 38:
vb.scrollByY(-P.keyboardSpeed, !1);
break;
case 34:
case 32:
vb.scrollByY(S * P.scrollPagePercent, !1);
break;
case 33:
vb.scrollByY(-S * P.scrollPagePercent, !1);
break;
case 39:
vb.scrollByX(P.keyboardSpeed, !1);
break;
case 37:
vb.scrollByX(-P.keyboardSpeed, !1)
}
return e=a!=db||b!=ab
}
var c, e, f=[];
Z&&f.push(lb[0]), Y&&f.push(eb[0]), Q.focus(function(){
d.focus()
}), d.attr("tabindex", 0).unbind("keydown.jsp keypress.jsp").bind("keydown.jsp", function(d){
if(d.target===this||f.length&&a(d.target).closest(f).length){
var g=db,
h=ab;
switch (d.keyCode){
case 40:
case 38:
case 34:
case 32:
case 33:
case 39:
case 37:
c=d.keyCode, b();
break;
case 35:
x(V - S), c=null;
break;
case 36:
x(0), c=null
}
return e=d.keyCode==c&&g!=db||h!=ab, !e
}}).bind("keypress.jsp", function(a){
return a.keyCode==c&&b(), !e
}), P.hideFocus ? (d.css("outline", "none"), "hideFocus" in T[0]&&d.attr("hideFocus", !0)):(d.css("outline", ""), "hideFocus" in T[0]&&d.attr("hideFocus", !1))
}
function K(){
d.attr("tabindex", "-1").removeAttr("tabindex").unbind("keydown.jsp keypress.jsp")
}
function L(){
if(location.hash&&location.hash.length > 1){
var b, c, d=escape(location.hash.substr(1));
try {
b=a("#" + d + ', a[name="' + d + '"]')
} catch (e){
return
}
b.length&&Q.find(d)&&(0===T.scrollTop() ? c=setInterval(function(){
T.scrollTop() > 0&&(z(b, !0), a(document).scrollTop(T.position().top), clearInterval(c))
}, 50):(z(b, !0), a(document).scrollTop(T.position().top)))
}}
function M(){
a(document.body).data("jspHijack")||(a(document.body).data("jspHijack", !0), a(document.body).delegate("a[href*=#]", "click", function(c){
var d, e, f, g, h, i, j=this.href.substr(0, this.href.indexOf("#")),
k=location.href;
if(-1!==location.href.indexOf("#")&&(k=location.href.substr(0, location.href.indexOf("#"))), j===k){
d=escape(this.href.substr(this.href.indexOf("#") + 1));
try {
e=a("#" + d + ', a[name="' + d + '"]')
} catch (l){
return
}
e.length&&(f=e.closest(".jspScrollable"), g=f.data("jsp"), g.scrollToElement(e, !0), f[0].scrollIntoView&&(h=a(b).scrollTop(), i=e.offset().top, (h > i||i > h + a(b).height())&&f[0].scrollIntoView()), c.preventDefault())
}}))
}
function N(){
var a, b, c, d, e, f = !1;
T.unbind("touchstart.jsp touchmove.jsp touchend.jsp click.jsp-touchclick").bind("touchstart.jsp", function(g){
var h=g.originalEvent.touches[0];
a=A(), b=B(), c=h.pageX, d=h.pageY, e = !1, f = !0
}).bind("touchmove.jsp", function(g){
if(f){
var h=g.originalEvent.touches[0],
i=db,
j=ab;
return vb.scrollTo(a + c - h.pageX, b + d - h.pageY), e=e||Math.abs(c - h.pageX) > 5||Math.abs(d - h.pageY) > 5, i==db&&j==ab
}}).bind("touchend.jsp", function(){
f = !1
}).bind("click.jsp-touchclick", function(){
return e ? (e = !1, !1):void 0
})
}
function O(){
var a=B(),
b=A();
d.removeClass("jspScrollable").unbind(".jsp"), d.replaceWith(Ab.append(Q.children())), Ab.scrollTop(a), Ab.scrollLeft(b), rb&&clearInterval(rb)
}
var P, Q, R, S, T, U, V, W, X, Y, Z, $, _, ab, bb, cb, db, eb, fb, gb, hb, ib, jb, kb, lb, mb, nb, ob, pb, qb, rb, sb, tb, ub, vb=this,
wb = !0,
xb = !0,
yb = !1,
zb = !1,
Ab=d.clone(!1, !1).empty(),
Bb=a.fn.mwheelIntent ? "mwheelIntent.jsp":"mousewheel.jsp";
"border-box"===d.css("box-sizing") ? (sb=0, tb=0):(sb=d.css("paddingTop") + " " + d.css("paddingRight") + " " + d.css("paddingBottom") + " " + d.css("paddingLeft"), tb=(parseInt(d.css("paddingLeft"), 10)||0) + (parseInt(d.css("paddingRight"), 10)||0)), a.extend(vb, {
reinitialise: function(b){
b=a.extend({}, P, b), f(b)
},
scrollToElement: function(a, b, c){
z(a, b, c)
},
scrollTo: function(a, b, c){
y(a, c), x(b, c)
},
scrollToX: function(a, b){
y(a, b)
},
scrollToY: function(a, b){
x(a, b)
},
scrollToPercentX: function(a, b){
y(a * (U - R), b)
},
scrollToPercentY: function(a, b){
x(a * (V - S), b)
},
scrollBy: function(a, b, c){
vb.scrollByX(a, c), vb.scrollByY(b, c)
},
scrollByX: function(a, b){
var c=A() + Math[0 > a ? "floor":"ceil"](a),
d=c / (U - R);
t(d * cb, b)
},
scrollByY: function(a, b){
var c=B() + Math[0 > a ? "floor":"ceil"](a),
d=c / (V - S);
r(d * _, b)
},
positionDragX: function(a, b){
t(a, b)
},
positionDragY: function(a, b){
r(a, b)
},
animate: function(a, b, c, d){
var e={};
e[b]=c, a.animate(e, {
duration: P.animateDuration,
easing: P.animateEase,
queue: !1,
step: d
})
},
getContentPositionX: function(){
return A()
},
getContentPositionY: function(){
return B()
},
getContentWidth: function(){
return U
},
getContentHeight: function(){
return V
},
getPercentScrolledX: function(){
return A() / (U - R)
},
getPercentScrolledY: function(){
return B() / (V - S)
},
getIsScrollableH: function(){
return Z
},
getIsScrollableV: function(){
return Y
},
getContentPane: function(){
return Q
},
scrollToBottom: function(a){
r(_, a)
},
hijackInternalLinks: a.noop,
destroy: function(){
O()
}}), f(e)
}
return d=a.extend({}, a.fn.jScrollPane.defaults, d), a.each(["arrowButtonSpeed", "trackClickSpeed", "keyboardSpeed"], function(){
d[this]=d[this]||d.speed
}), this.each(function(){
var b=a(this),
c=b.data("jsp");
c ? c.reinitialise(d):(a("script", b).filter('[type="text/javascript"],:not([type])').remove(), c=new e(b, d), b.data("jsp", c))
})
}, a.fn.jScrollPane.defaults={
showArrows: !1,
maintainPosition: !0,
stickToBottom: !1,
stickToRight: !1,
clickOnTrack: !0,
autoReinitialise: !1,
autoReinitialiseDelay: 500,
verticalDragMinHeight: 0,
verticalDragMaxHeight: 99999,
horizontalDragMinWidth: 0,
horizontalDragMaxWidth: 99999,
contentWidth: c,
animateScroll: !1,
animateDuration: 300,
animateEase: "linear",
hijackInternalLinks: !1,
verticalGutter: 4,
horizontalGutter: 4,
mouseWheelSpeed: 3,
arrowButtonSpeed: 0,
arrowRepeatFreq: 50,
arrowScrollOnHover: !1,
trackClickSpeed: 0,
trackClickRepeatFreq: 70,
verticalArrowPositions: "split",
horizontalArrowPositions: "split",
enableKeyboardNavigation: !0,
hideFocus: !1,
keyboardSpeed: 0,
initialDelay: 300,
speed: 30,
scrollPagePercent: .8
}}(jQuery, this);
jQuery(document).ready(function($){
$('.gm-style-iw').parent().parent().addClass('wpgmp_infowindow_css');
$("div.scroll-pane").jScrollPane();
$(".accordion").accordion({
speed: "slow"
});
$('span a').on('click', function(e){
var elem=$('div.wpgmp_categories');
if($(this).hasClass('wpgmp_grid')){
elem.fadeOut(500, function(){
elem.removeClass('wpgmp_listing_list').addClass('wpgmp_listing_grid');
$('.wpgmp_locations').equalHeightGrid();
elem.fadeIn(500);
});
}else if($(this).hasClass('wpgmp_list')){
elem.fadeOut(500, function(){
elem.removeClass('wpgmp_listing_grid').addClass('wpgmp_listing_list');
$('.wpgmp_locations').equalHeightGrid();
elem.fadeIn(500);
});
}});
});
(function($){
"use strict";
function getjQueryObject(string){
var jqObj=$("");
try {
jqObj=$(string).clone();
} catch (e){
jqObj=$("").html(string);
}
return jqObj;
}
function isNode(o){
return !!(typeof Node==="object" ? o instanceof Node:o&&typeof o==="object"&&typeof o.nodeType==="number"&&typeof o.nodeName==="string");
}
$.print=$.fn.print=function(){
var options, $this, self=this;
if(self instanceof $){
self=self.get(0);
}
if(isNode(self)){
$this=$(self);
if(arguments.length > 0){
options=arguments[0];
}}else{
if(arguments.length > 0){
$this=$(arguments[0]);
if(isNode($this[0])){
if(arguments.length > 1){
options=arguments[1];
}}else{
options=arguments[0];
$this=$("html");
}}else{
$this=$("html");
}}
var defaults={
globalStyles: true,
mediaPrint: false,
stylesheet: null,
noPrintSelector: ".no-print",
iframe: true,
append: null,
prepend: null
};
options=$.extend({}, defaults, (options||{}));
var $styles=$("");
if(options.globalStyles){
$styles=$("style, link, meta, title");
}else if(options.mediaPrint){
$styles=$("link[media=print]");
}
if(options.stylesheet){
$styles=$.merge($styles, $(''));
}
var copy=$this.clone();
copy=$("").append(copy);
copy.find(options.noPrintSelector).remove();
copy.append($styles.clone());
copy.append(getjQueryObject(options.append));
copy.prepend(getjQueryObject(options.prepend));
var content=copy.html();
copy.remove();
var w, wdoc;
if(options.iframe){
try {
var $iframe=$(options.iframe + "");
var iframeCount=$iframe.length;
if(iframeCount===0){
$iframe=$('').prependTo('body').css({
"position": "absolute",
"top": -999,
"left": -999
});
}
w=$iframe.get(0);
w=w.contentWindow||w.contentDocument||w;
wdoc=w.document||w.contentDocument||w;
wdoc.open();
wdoc.write(content);
wdoc.close();
setTimeout(function(){
w.focus();
w.print();
setTimeout(function(){
if(iframeCount===0){
$iframe.remove();
}}, 100);
}, 250);
} catch (e){
console.error("Failed to print from iframe", e.stack, e.message);
w=window.open();
w.document.write(content);
w.document.close();
w.focus();
w.print();
w.close();
}}else{
w=window.open();
w.document.write(content);
w.document.close();
w.focus();
w.print();
w.close();
}
return this;
};})(jQuery);
(function($){
$.fn.equalHeight=function(){
var heights=[];
$.each(this, function(i, element){
$element=$(element);
var element_height;
var includePadding=($element.css('box-sizing')=='border-box')||($element.css('-moz-box-sizing')=='border-box');
if(includePadding){
element_height=$element.innerHeight();
}else{
element_height=$element.height();
}
heights.push(element_height);
});
this.css('height', Math.max.apply(window, heights) + 'px');
return this;
};
$.fn.equalHeightGrid=function(columns){
var $tiles=this;
$tiles.css('height', 'auto');
for (var i=0; i < $tiles.length; i++){
if(i % columns===0){
var row=$($tiles[i]);
for (var n=1; n < columns; n++){
row=row.add($tiles[i + n]);
}
row.equalHeight();
}}
return this;
};
$.fn.detectGridColumns=function(){
var offset=0,
cols=0;
this.each(function(i, elem){
var elem_offset=$(elem).offset().top;
if(offset===0||elem_offset==offset){
cols++;
offset=elem_offset;
}else{
return false;
}});
return cols;
};
$.fn.responsiveEqualHeightGrid=function(){
var _this=this;
function syncHeights(){
var cols=_this.detectGridColumns();
_this.equalHeightGrid(cols);
}
$(window).bind('resize load', syncHeights);
syncHeights();
return this;
};})(jQuery);